<?php
if(!defined('BZ_XTBLOG') || !defined('BZ_WJSCUZ')) {
	exit('Access Denied');
}
if(!plugin_Authorize(plugin_szname('Bingz_liaotian_password'))) {
    $plugin_title='插件未授权 - ';
    $plugin_keywords='插件未授权,';
    $plugin_description='插件未授权 - ';
    $plugin_password_name=$plugin_password_name_ts;
}else{
$plugin_title='聊天室 - ';
$plugin_keywords='聊天室,';
$plugin_description='聊天室 - ';
$user_czqx=$user_class->user_qx('','',$user_uid);
$fid=$_GET[fid];
$liaotian_cnt=$db->get_one('plugin_liaotian_class'," `id` ='$fid' ",'');
$liaotianummm=$_COOKIE['liaotian_'.$liaotian_cnt['id'].''];
$contentgg=$ubb->content_ubb($liaotian_cnt[content]);
$name=$liaotian_cnt[name];


if(!$user_uid){
	  $pdid='1';
}elseif(!$liaotian_cnt){
	  $pdid='2';
}elseif($_GET[act] == 'ok'){
	  if($liaotian_cnt['pass'] == $_POST['mm'] ){
	 	   setcookie("liaotian_".$liaotian_cnt['id']."",$_POST['mm'],time()+60*60*24*30);
	 	   $pdid='4';
    }else{
	     $pdid='5';
	  }
}elseif($_GET[act] == 'lah'){
	 if($user_czqx or $db->get_one('plugin_liaotian_class',"`uid` = '$user_uid' and `id` = '$fid' ",'')){
	 	  $time_bb=$time_jt-(3600*24*5);
		  $sqma=$db->query('plugin_liaotian'," `lid` = '$fid' and `time_a` > '$time_bb' ORDER BY `id` DESC ",' distinct uid');
      while($mmw=mysql_fetch_array($sqma)){
           if(!$db->get_one('plugin_liaotian_xhw',"type = '1' and `lid` = '$fid' and `uid` ='$mmw[uid]'",'')){
             	$hyname=$user_class->user_name($mmw[uid]);
              $liao[]=array("uid"=>"$mmw[uid]","name"=>"$hyname");
           }
      }
   }else{
   	  $tsid='1';
   }
    $pdid='6';
}elseif($liaotian_cnt['pass'] && $liaotian_cnt['pass'] != $liaotianummm){
	 $pdid='3';
}else{
   $num_count=$db->num_rows('plugin_liaotian'," `lid` ='$fid' ",'id');
   $list_num ="15";
   $num_start=page_num($list_num,$num_count);
   $sql_bbs  =$db->query('plugin_liaotian'," `lid` ='$fid' ORDER BY `id` DESC LIMIT ".$num_start." , ".$list_num." ",'');
   $a=$num_count-$num_start;
   while($row_b=mysql_fetch_array($sql_bbs)){
       $hyname=$user_class->user_name($row_b['uid']);
       $hynamej=$user_class->user_name($row_b[uid],'1');
       $hytx  =$user_class->user_tx($row_b['uid']);
       $content=$ubb->content_ubb($row_b[content]);
       $tsj=Bingz_time($row_b['time_a']);
       $liao[]= array('hytx' => $hytx,'hyname' => $hyname,'hynamej' => $hynamej,'type' => $row_b['type'],'name' => $content,'sj' => $tsj,'id' => $a);
       $a--;
   }
   $page=page_link($list_num,$num_count); 
}
$templatesplugin='list.htm';
}
?>